<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>reduce</title>
</head>
<body>
<script>
    let arr = [1, 2, 3, 4, 5, 6];
    let arr1 = arr.reduce((a, b) => a + b);
    console.log(arr);
    console.log(arr1);
</script>
</body>
</html>